func fetch<%= resource_name %>ByList(d *schema.ResourceData, client *golangsdk.ServiceClient) (interface{}, error) {
<% query_link = build_list_query_params(list_api, 4) -%>
<% unless query_link.empty? -%>

<%=  lines(query_link) -%>

<% end -%>
<% if list_api.path.include?("{") -%>
    link, err := replaceVars(d, "<%= list_api.path -%>", nil)
    if err != nil {
        return nil, err
    }
    link = client.ServiceURL(link)<%= query_link.empty? ? "" : " + queryLink" %>
<% else -%>
    link := client.ServiceURL(<%= sprintf("\"%s\"", list_api.path) -%>)<%= query_link.empty? ? "" : " + queryLink" %>
<% end -%>

    return find<%= resource_name %>ByList(client, link, d.Id())
}
